<!DOCTYPE HTML>
<html>
<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>批量上传</title>
<script src="__PUBLIC__/system/js/jquery.js" type="text/javascript"></script>
<script src="__PUBLIC__/system/js/jquery.uploadify.min.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="__PUBLIC__/system/css/uploadify.css">

</head>

<body style="
  background-repeat: no-repeat;
  background-attachment: fixed;-webkit-background-size: cover;
  -moz-background-size: cover;
  -o-background-size: cover;
  background-size: cover;
  zoom: 1;height: 100%;
  font-size: 12px;
  width: 100%;">

<div style="width:100%;text-align:center; margin-top:100px;">
<form  method="post"  action="{:U('Product/indexp')}">
   <select name="id"   >

<volist name='pro' id='li'>
     <option value="{$li.id}" >{$li.html}{$li.name}</option>
     </volist>
   </select>
    产品名称：<input name="name"  type="text"  value="" />

                  <label>缩略图：<input name="limg"  type="checkbox" checked = "checked" value="1" /></label> 
                  <span>宽：</span><input type="" style="width: 50px;" name="width" value="{$width}">
                  <span>高：</span><input type="" style="width: 50px;" name="height" value="{$height}">

                  <input type="submit"  value="确定">
 </form>
<br>
<br>
 <dd style="width:500px; margin-left:auto;margin-right:auto;">已选定的分类：<span style="color:#f00;font-weight: bold;">{$b.name}</span></dd>
<br>
<br>  


<div style="margin-left:auto;margin-right:auto;width:500px;text-align:center;">

<form>
    <input id="file_upload" name="file_upload" type="file" multiple="true">
    <div id="image" class="image"></div>
    <input type="hidden" id="url" value="__URL__">
    <input type="hidden" id="root" value="__ROOT__">
    <input type="hidden" id="public" value="__PUBLIC__">
     <input type="hidden" id="case_uid" value="{$b.case_uid}">
     <input type="hidden" id="width" value="{$width}">
     <input type="hidden" id="height" value="{$height}">
     <input type="hidden" id="uid" value="{$a}">
     <input type="hidden" id="name" value="{$name}">

     </form>
  <script type="text/javascript">
    function del(delName,delId){      //点击删除链接，ajax
      var info=$('#url').val();  //获取url
      var d='#'+delName;
    var url=info+"/del";    //删除图片的路径
         $.post(url,{'name':delId},function(data){    //ajax后台
            $(d).html(data.info);           //输出后台返回信息
            $(d).hide(3000);              //自动隐藏
        },'json');                    //josn格式

    }
    $(function() {
      $('#file_upload').uploadify({
        'formData'     : {
          'timestamp' : '{$time}',            //时间
          'token'     : '{$time | md5}',    //加密字段
          'url'   : $('#url').val()+'/upload/', //url
          'uid'   : $('#uid').val(), //url
          'width'   : $('#width').val(), //width
          'case_uid'   : $('#case_uid').val(), //case_uid
          'name'   : $('#name').val(), //name
          'imageUrl'  : $('#root').val()       //root
        },

        'fileTypeDesc' : 'Image Files',         //类型描述
        //'removeCompleted' : false,    //是否自动消失
            'fileTypeExts' : '*.gif; *.jpg; *.png',   //允许类型
            'fileSizeLimit' : '3MB',          //允许上传最大值
        'swf'      : $('#public').val()+'/system/js/uploadify.swf', //加载swf
        'uploader' : $('#url').val()+'/uploadify',          //上传路径
        'buttonText' :'文件上传',                 //按钮的文字

        'onUploadSuccess' : function(file, data, response) {      //成功上传返回
              var n=parseInt(Math.random()*100);                //100以内的随机数
              //alert(n+data);
              //插入到image标签内，显示图片的缩略图
       

        }

      });
    });
  </script></div>
</div>
</body>
</html>